import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/login.vue'
import Home from '../components/Home.vue'
import Index from '../components/home/index.vue'
import Detail from '../components/home/detail.vue'
import List from '../components/home/list.vue'
import Admin from '../components/admin.vue'
import Adindex from '../components/admin/index.vue'
import Users from '../components/admin/users.vue'
import Posts from '../components/admin/article/posts.vue'
import PostAdd from '../components/admin/article/post-add.vue'
import Categories from '../components/admin/article/categories.vue'
import Comments from '../components/admin/comments.vue'
import Slides from '../components/admin/settings/slides.vue'
import Settings from '../components/admin/settings/settings.vue'


Vue.use(VueRouter)

const routes = [{
		path: '/',
		redirect: '/home/index'
	},
	{
		path: '/home',
		component: Home,
		redirect: '/index',
		children: [{
				path: '/home/index',
				component: Index
			}, {
				path: '/home/etail',
				component: Detail
			},
			{
				path: '/home/list',
				component: List
			},
		]
	},
	{
		path: '/login',
		component: Login
	},
	{
		path: '/admin',
		component: Admin,
		redirect: 'admin/index',
		children: [{
				path: '/admin/index',
				component: Adindex
			},
			{
				path: '/admin/posts',
				component: Posts
			},
			{
				path: '/admin/post-add',
				component: PostAdd
			},
			{
				path: '/admin/categories',
				component: Categories
			},
			{
				path: '/admin/comments',
				component: Comments
			},
			{
				path: '/admin/users',
				component: Users
			},
			{
				path: '/admin/slides',
				component: Slides
			},
			{
				path: '/admin/settings',
				component: Settings
			}
		]
	}
]

const router = new VueRouter({
	routes
})

export default router